package io.p2p.stream.stun.util;

import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

@Slf4j
public class PropertiesUtil {
    public static Properties loadConfig(String configFile){
        Properties properties = new Properties();
        try (InputStream input = PropertiesUtil.class.getClassLoader().getResourceAsStream(configFile)) {
            if (input != null) {
                properties.load(input);
            } else {
                log.error("Unable to load configuration file: " + configFile);
            }
        } catch (IOException e) {
            log.error(e.getMessage());
        }
        return properties;
    }
}
